

#ifndef _NORFLASH_H_
#define _NORFLASH_H_

#include "silan_types.h"

 #define PAGE_SIZE			  (0x100)	    /* 256 byte */
 #define SECTOR_SIZE          (0x1000)      /* 4 Kbyte */
 #define BLOCK_SIZE           (0x10000)     /* 64 Kbyte */
 #define FLASH_SIZE			  (0x400000)    /* 4 MBytes */


int32_t iap_norflash_init(void);
int32_t EraseSomeSectors(uint32_t addr, uint32_t size);
int32_t EraseSomeBlocks(uint32_t addr, uint32_t size);
int32_t ProgramOnePackage(char *data, uint32_t addr, uint32_t size);
uint32_t GetFlashCapacity(void);

#endif













































































































































































